package com.forte.orderdao;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;


@Entity(name="orderdetails")
public class OrderDetails implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;	
	
	@Id
	@Column(name="orderdetails_id")
	private int orderDetailsId;
	
	@Column(name="order_id")
	private String orderId;
	
	@Column(name="product_id")
	private int productId;
	
	@Column(name="quantity")
	private int quantity;
	
	@Column(name="price")
	private double price;
	
	@Column(name="total")
	private double total;
	
	@ManyToOne(cascade = CascadeType.ALL)
	@JoinColumn(name="order_id", insertable=false, updatable=false)
	private Order order;

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public int getProductId() {
		return productId;
	}

	public void setProductId(int productId) {
		this.productId = productId;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public double getTotal() {
		return total;
	}

	public void setTotal(double total) {
		this.total = total;
	}

	public Order getOrder() {
		return order;
	}

	public int getOrderDeatilsId() {
		return orderDetailsId;
	}

	public void setOrderDeatilsId(int orderDetailsId) {
		this.orderDetailsId = orderDetailsId;
	}
}
